package com.neighbor.neighborhooduser.controller;

import com.neighbor.neighborhooduser.dao.IItemCategoriesDao;
import com.neighbor.neighborhooduser.pojo.ItemCategories;
import com.neighbor.neighborhooduser.service.IItemCategoriesService;
import com.neighbor.neighborhooduser.utils.ResponseMsg;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 物品分类表 前端控制器
 * </p>
 *
 * @author song
 * @since 2025-09-22 09:13:04
 */
@RestController
@RequestMapping("/itemCategories")
public class ItemCategoriesController {
    @Autowired
    IItemCategoriesService itemCategoriesService;
    @Autowired
    private IItemCategoriesService iItemCategoriesService;
    @RequestMapping("/getType")
    List<ItemCategories> getType(){
        return iItemCategoriesService.list();
    }


/**
     *      在数据库中查询物品的种类
     * @return  物品种类(List)
     */
    @RequestMapping("sel")
    ResponseMsg sel(){
        return ResponseMsg.getInstance(ResponseMsg.SUCCESS,"获取物品类型",iItemCategoriesService.list());
    }
}
